<form class="form-inline" method="get">
    <div class="form-group col-xs-6">
        <div class="col-xs-12">
            <input class="form-control" name="condition" value="{$condition}"
                   placeholder="分类名称">
        </div>
    </div>
    <div class="form-group col-xs-3">
        <button type="submit" class="btn btn-success">
            搜索
        </button>
    </div>
    <div class="form-group col-xs-3" style="text-align: right;">
        <button type="button" class="btn btn-primary" onclick="modal('{:url(\'addCategory\')}','添加联盟商分类')">
            添加联盟商分类
        </button>
    </div>
</form>

<hr>

<table class="table table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>分类名称</td>
        <td>缩略图</td>
        <td>排序</td>
        <td>显示</td>
        <td>编辑时间</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td>{$item.title}</td>
        <td>
            <a href="javascript:void(0);" onclick="ejectImg('{$item.thumb}','联盟商分类【{$item.title}】缩略图');">
                <img style="width:60px;height:60px;" src="{$item.thumb}">
            </a>
        </td>
        <td>{$item.display_order}</td>
        <td>
            {if condition="$item.is_visible == 1"}
            显示
            {else/}
            隐藏
            {/if}
        </td>
        <td>{$item.update_time|show_datetime}</td>
        <td>

            <?php $editTitle = '编辑联盟商分类'; ?>
            <button type="button" class="btn btn-default" onclick="modal('{:url(\'editCategory\',array(\'cid\'=>$item[\'id\']))}','{$editTitle}')">
                <i class="fa fa-edit"></i>
                编辑
            </button>
            <button type="button" class="btn btn-danger" data-toggle="confirm" data-title="删除联盟商分类"
                    data-content="{$item.title}将被删除，确认删除？" data-url="{:url('removeCategory',array('cid'=>$item['id']))}">
                <i class="fa fa-times"></i>
                删除
            </button>

        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$list->render()}
    </div>
</div>